package cn.edu.stu.syllabus.utils;

import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.scalars.ScalarsConverterFactory;

/**
 * Created by daidaijie on 2017/3/10.
 */

public class LibraryRetrofit {
    private Retrofit mRetrofit;

    private LibraryRetrofit() {
        mRetrofit = new Retrofit.Builder()
                .baseUrl("http://opac.lib.stu.edu.cn:83/opac/")
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .addConverterFactory(ScalarsConverterFactory.create())
                .build();
    }

    public static Retrofit getRetrofit() {
        return LibraryRetrofitHolder.sLibraryRetrofit.mRetrofit;
    }

    private static class LibraryRetrofitHolder {
        public static LibraryRetrofit sLibraryRetrofit = new LibraryRetrofit();
    }

}
